package org.jrpc.base;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ServiceInfo implements Serializable {

    /**
     * 服务的唯一id
     */
    private String id;
    /**
     * 服务地址
     */
    private String host;
    /**
     * 服务名字
     */
    private String serviceName;
    /**
     * 服务端口
     */
    private int port;
    /**
     * 版本号，默认版本号都可以访问
     */
    private String vaersion="all";
    /**
     * 分组，默认所有组别都可以访问
     */
    private String group="all";

    /**
     * 服务状态，上线 UP，下线 DOWN，
     */
    private String status="";

    /**
     * 数据元
     */
    private Map<String,String> metaData =new HashMap<>();

    public ServiceInfo() {
    }

    public ServiceInfo(String id, String serviceName, String host, int port, String status) {
        this.id = id;
        this.serviceName = serviceName;
        this.host = host;
        this.port = port;
        this.status = status;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getVaersion() {
        return vaersion;
    }

    public void setVaersion(String vaersion) {
        this.vaersion = vaersion;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Map<String, String> getMetaData() {
        return metaData;
    }

    public void setMetaData(Map<String, String> metaData) {
        this.metaData = metaData;
    }
}
